package net.shopxx.bean;

import net.shopxx.util.CommonUtil;

import org.apache.commons.lang.StringUtils;

public class SpecificationValue
  implements Comparable<SpecificationValue>
{
  private String id = CommonUtil.getUUID();
  private String name;
  private String imagePath;
  private Integer orderList;

  public String getId()
  {
    return this.id;
  }

  public void setId(String paramString)
  {
    this.id = paramString;
  }

  public String getName()
  {
    return this.name;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public String getImagePath()
  {
    return this.imagePath;
  }

  public void setImagePath(String paramString)
  {
    if (StringUtils.isEmpty(paramString))
      paramString = null;
    this.imagePath = paramString;
  }

  public Integer getOrderList()
  {
    return this.orderList;
  }

  public void setOrderList(Integer paramInteger)
  {
    this.orderList = paramInteger;
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == null)
      return false;
    if ((paramObject instanceof SpecificationValue))
    {
      SpecificationValue localSpecificationValue = (SpecificationValue)paramObject;
      if ((getId() == null) || (localSpecificationValue.getId() == null))
        return false;
      return getId().equals(localSpecificationValue.getId());
    }
    return false;
  }

  public int hashCode()
  {
    return this.id == null ? System.identityHashCode(this) : (getClass().getName() + getId()).hashCode();
  }

  public int compareTo(SpecificationValue paramSpecificationValue)
  {
    if (paramSpecificationValue.getOrderList() == null)
      return 1;
    if (getOrderList() == null)
      return -1;
    return getOrderList().compareTo(paramSpecificationValue.getOrderList());
  }

}